package com.wk.springboot.spring.factoryBean;

import com.wk.springboot.spring.bean.Color;
import org.springframework.beans.factory.FactoryBean;

/**
 * @User admin
 * @Date 2020/11/23 15:17
 **/
public class MyFactoryBean implements FactoryBean<Color> {

    @Override
    public Color getObject() throws Exception {
        Color color = new Color();
        color.setName("red");
        return color;
    }

    @Override
    public Class<?> getObjectType() {
        return null;
//        return Color.class;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }
}
